#coding = utf-8
n = list(input('输入01串'))
def f (n):
    A,B = 1,1
    j = len(n)
    for i in n:
        if i == '0':
            B = 0
        if i == '1':
            A = 0
    if A == 1:
        return 'A'
    if B == 1:
        return 'B'
    return 'C' + f(n[:j//2]) + f(n[-j//2:])
print(f(n))